import torch


def test():
    """
    0-11的一个x行向量
    :return:
    """
    # x = torch.arange(12)
    # print(x)
    # print(type(x))
    # # 张量的形状 沿每个轴的长度
    # print(type(x.shape))
    # print(x.shape)
    # print(x.numel())  # 张量中元素的总数，即形状的所有元素乘积
    # X = x.reshape(3, 4)
    # print(X)

    # x =torch.ones((2, 3, 4))
    # print(x)

    # x = torch.randn(3, 4)
    # print(x)
    #
    # y = torch.tensor([[2, 1, 4, 3], [1, 2, 3, 4], [4, 3, 2, 1]])
    # print(y)

    # print(id([1], ))
    # print(id(1, ))
    # print(id((1,)))

    a = torch.tensor([3.5])
    a.item()
    print(a)
    print(type(a))
    print(a.item())
    print(type(a.item()))


if __name__ == '__main__':
    test()
